﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;
using System.Net;


namespace Web.Views.Controls
{
    public partial class CI : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string ret = GetPageHtml("http://train.travel.sohu.com/ci.php?ch=" + Request.QueryString["ci"]);

            Response.Write(ret);

        }

        protected string GetPageHtml(string url)
        {

            string pageinfo;

            try
            {

                WebRequest myreq = WebRequest.Create(url);

                WebResponse myrep = myreq.GetResponse();

                StreamReader reader = new StreamReader(myrep.GetResponseStream(), Encoding.GetEncoding("UTF-8"));

                pageinfo = reader.ReadToEnd();

            }

            catch
            {

                pageinfo = "";

            }

            return pageinfo;

        }


    }
}
